package com.a01_2021.thousandstimes.instance.service;

import com.a01_2021.thousandstimes.exception.CustomException;
import com.a01_2021.thousandstimes.instance.entity.OffWork;
import com.baomidou.mybatisplus.extension.service.IService;

import java.time.LocalDate;
import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author E1xP
 * @since 2021-03-21
 */
public interface IOffWorkService extends IService<OffWork> {
    OffWork request(long userId, LocalDate offWorkDate, int type, String reason) throws CustomException;

    boolean hasRequest(long userId, LocalDate offWorkDate);

    List<OffWork> getRequests(long userId) throws CustomException;

    List<OffWork> getAllRequests();

    List<OffWork> getALLUnHandleRequests();

    OffWork handleRequest(long handlerId, long requestId, int stats) throws CustomException;
}
